<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div>
      <textarea placeholder="请输入" value="" type="text"></textarea>
      <button>提交</button>
      <p>dddd</p>
    </div>
    <script>
      const textarea = document.querySelector("textarea");
      const button = document.querySelector("button");
      const p = document.querySelector("p");
      const div = document.querySelector("div");
      button.addEventListener("click", () => {
        div.append(textarea.value);
        p.append(textarea.value);
      });
      p.addEventListener("click", () => {
        p.remove();
      });
    </script>
  </body>
</html>
